package com.cloud.drore.eboss.sso.service;


import com.cloud.drore.eboss.sso.base.ResponseJson;
import com.cloud.drore.eboss.sso.base.ResultMessage;
import com.cloud.drore.eboss.sso.base.page.Pagination;
import com.cloud.drore.eboss.sso.base.page.PaginationResult;
import com.cloud.drore.eboss.sso.entity.EbossRoleRightRelation;
import com.cloud.drore.eboss.sso.entity.ShiroUser;
import com.cloud.drore.eboss.sso.po.UserAndFunction;
import org.springframework.transaction.annotation.Transactional;

import java.util.List;


public interface ShiroUserService extends EntityService<ShiroUser, Long> {
	
	public ShiroUser findByUsername(String username);

	ShiroUser findByUsernameAndPassword(String username, String password);

	public List<ShiroUser> findList(String username, Long typeId);

	public PaginationResult<ShiroUser> findAllByPage(Pagination<ShiroUser> pagination);

	public void editUser(ShiroUser shiroUser);

//	public ResponseJson editUserRole(String username, String roles);

	public ResponseJson del(String ids)throws Exception;
//	public ResponseJson audit(String userNameStr, int status) throws Exception;
	public ShiroUser findByUsernameForUpdate(String username);
	public ResultMessage addUser(ShiroUser shiroUser);

	@Transactional(rollbackFor=Exception.class)
	ResultMessage addUserAndFunction(ShiroUser shiroUser, List<EbossRoleRightRelation> roleRightRelations);

	public Boolean checkNameOrEmallExist(ShiroUser shiroUser);

	void updateUser(String password);

    UserAndFunction getUserFunction(Long id);

	void resetPassword(Long id);

    void disableUser(Long id, int status);

    ShiroUser getUserByTypeId(Long typeid);
}
